# Contributor: Oleg Titov <oleg.titov@gmail.com>
# Maintainer: Oleg Titov <oleg.titov@gmail.com>
pkgname=svt-hevc
pkgver=1.5.1
pkgrel=1
pkgdesc="Scalable Vector Technology for HEVC encoder (SVT-HEVC Encoder)"
url="https://01.org/svt"
arch="x86_64" # x86 error: incompatible type for argument 2 of '_mm_storel_epi64'
license="BSD-2-Clause-Patent"
options="!check" # No test suite from upstream
makedepends="cmake samurai yasm"
subpackages="$pkgname-dev $pkgname-doc $pkgname-libs"
source="$pkgname-$pkgver.tar.gz::https://github.com/OpenVisualCloud/SVT-HEVC/archive/v$pkgver.tar.gz"
builddir="$srcdir/SVT-HEVC-$pkgver"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_CXX_FLAGS="$CXXFLAGS" \
		-DCMAKE_C_FLAGS="$CFLAGS"
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build

	install -Dm 644 README.md -t "$pkgdir"/usr/share/doc/"$pkgname"
}

sha512sums="
f5b9d9a090cb04ada0a3f310522f00b619ae628b8474fe7e1c7f562a017b5a9d0c8c58ab9a35b43cb19f2568fbc59e0395dcd517b7983924b175393ad2ba4299  svt-hevc-1.5.1.tar.gz
"
